ABC287 D - Match or Not
提出
TLE
code: python
s = input()
t = input()
# ?????
# coder
# a oder
# at der
# atc er
# atco r
# atcod
len_s = len(s)
len_t = len(t)
for x in range(len_t+1):
flag = True
for i in range(len_t):
if ti != "?" and targeti != "?" and ti != targeti: flag = False
print("Yes") if flag else print("No")
解答
code: python
s = input()
t = input()
# ?????
# coder
# a oder
# at der
# atc er
# atco r
# atcod
# s の先頭 i 文字と t の先頭 i 文字までマッチするかどうかを表す配列
# s の末尾 i 文字と t の末尾 i 文字までマッチするかどうかを表す配列
for i in range(len(t)):
if si == ti or si == "?" or ti == "?": else:
# あとはマッチしない
break
for i in range(1, len(t)+1):
if s-i == t-i or s-i == "?" or t-i == "?": else:
# あとはマッチしない
break
# print(start)
# print(end)
for i in range(len(t)+1):
# 前から取ってきたものと後ろから取ってきたものの全てがマッチ
print("Yes")
else:
print("No")
メモ
https://youtu.be/CH1bid_H7XA?t=3680
提出
code: python
s = input()
t = input()
# O(pow(10, 5)*2)
for x in range(len(t)+1):
ans = "Yes"
for i in range(len(t)):
if sdashi == "?" or ti == "?": continue
else:
ans = "No"
print(ans)